/**
 * 
 */
package com.admin.his.config.convertor;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * @author 张三
 *
 */
@Component
public class StringTrimConvertor implements Converter<String, String>{
	{
		System.out.println("StringTrimConvertor我被注册了");
	}
	@Override
	public String convert(String source) {
		if(source!=null) {
			if((source=source.trim()).length()==0) {
				return null;
			}
		}
		return source;
	}

}
